﻿using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour 
{
	public Vector3 offset;
	public Camera mainCamera;

	private Transform playerTransform;
	private Transform shootingTransform;

	void Awake()
	{
		playerTransform = GameObject.FindGameObjectWithTag ("ShootingTarget").transform;

	}

	void Update () 
	{


		Vector3 newCamera = playerTransform.position + offset;
		mainCamera.transform.position = newCamera;

	

		mainCamera.transform.LookAt (playerTransform.position);



	}
}
